﻿<?php 
include 'Conf.php';
Conf::import( include '../../../conf/msgconf.php' );
$a=file_get_contents( Conf::get( 'txtMouldForTarget' ));
$b=file_get_contents( Conf::get( 'txtMouldForOthers' ));
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>系统设置</title>
<script src="../../../../js/jquery-1.3.1.js" type="text/javascript"></script>
<script src="../../../../js/cookie.js" type="text/javascript"></script>

	<script type="text/javascript">
		function send(obj){
			var r=confirm("确认修改？");
			if(r){
				var var1,var2,type;
				if(obj.name=='sendMail'){
					type=0;
					if(var1==''||var1==null||var2==""||var2==null){
						alert("不能为空！请重新输入");
						window.location.reload(); 
						return;
					}
					var1=document.getElementById('accMail').value;
					var2=document.getElementById('pwdMail').value;
				}else if(obj.name=='sendQQ'){
					type=1;
					var1=document.getElementById('accQQ').value;
					var2=document.getElementById('pwdQQ').value;
				}else if(obj.name=='sendTareget'){
					type=2;
					var1=document.getElementById('muban1').value;
					var2=null;
				}else if(obj.name=='sendOthers'){
					type=3;
					var1=document.getElementById('muban2').value;
					var2=null;
				}
				
				 $.ajax({
				type:"POST", 
				async:false, 
				cache:false, 
				url: 'change.php' ,
				data:{type:type,var1:var1,var2:var2},   
				success:function(msg)// 
				{     // 如果提交成功可以在这进行一些后续操作  
					var i=msg.indexOf('0')
					if(msg!=-1){
						alert("保存成功！")
						window.location.reload(); 
					}
				}   
			 }); 
			}
		}
	</script>
</head>
<body>
	
		 <label for="subject" >系统QQ邮箱账号:</label><br/>
         <input type="text" id='accMail' name="accMail" value="<?php echo Conf::get( 'sysMailAccount' )?> "  ><br>
		 <br/>
         <label for="body" >系统QQ邮箱密码:</label><br/>
		 <input type="password" id='pwdMail' name="pwdMail" value="<?php echo Conf::get( 'pwdMail' )?>" ><br>
		 <input type="button" id='sendMail' name="sendMail" value="保存" onClick="send(this)"/>
		 <br/>
		
		<label for="subject" >系统QQ账号:</label><br/>
         <input type="text" id='accQQ' name="accQQ" value="<?php echo Conf::get( 'sysQQAccount' )?>"><br>
		 <br/>
         <label for="body" >系统QQ密码:</label><br/>
		<input type="password" id='pwdQQ' name="pwdQQ" value="<?php echo Conf::get( 'pwdQQ' )?>"><br>
		<input type="button" name="sendQQ" value="保存" onClick="send(this)"/>
		 <br/>
		 
		<label for="body" >发送给生日者模板:</label><br/>
        <textarea id="muban1" name="muban1"  rows="15"cols="30" ><?php echo $a?></textarea>
		<input type="button" name="sendTareget" value="保存" onClick="send(this)"/>
		<br/>
		
		<label for="body" >发送给通知者模板:</label><br/>
        <textarea id="muban2" name="muban2"  rows="15"cols="30" ><?php echo $b?></textarea>
	    <br/>
	    <input type="button" name="sendOthers" value="保存" onClick="send(this)"/>
	    <br/>
	    <div id="emailProcessing"></div>
	

</body>
</html>
